/**
 * 由 WangYu 创建
 * 日期 2017/9/5
 */
import React, {Component} from 'react';
import {
    StyleSheet,
    Text,
    View,
    Image,
    ToastAndroid, Switch, ScrollView,
} from 'react-native';
import TitleBar from "../mycomponent/TitleBar";
import CommonItemView from "../mycomponent/CommonItemView";
export default class MorePage extends Component {

    constructor(props) {
        super(props);
        this.state={
            switch:false,
        }
    }

    render() {
        return (

            <View style={styles.container}>
                <TitleBar leftIcon={'a'}
                          rightIcon="icon_mine_setting"
                          title='更多'
                              onRightIconPress={()=>ToastAndroid.show('点击了右侧',ToastAndroid.SHORT)}/>
                <ScrollView style={{flex:1}}>

                <View style={styles.style1}/>
                <CommonItemView title="扫一扫"
                                onPress={()=>ToastAndroid.show('saoyisao',ToastAndroid.SHORT)}/>
                <View style={styles.style1}/>
                <CommonItemView title="省流量模式"
                                rightIcon={this.renderSwitch()}/>
                <CommonItemView title="消息提醒"/>
                <CommonItemView title="邀请好友"/>
                <CommonItemView title="清空缓存"/>
                <View style={styles.style1}/>
                <CommonItemView title="意见反馈"/>
                <CommonItemView title="问卷调查"/>
                <CommonItemView title="支付帮助"/>
                <CommonItemView title="网络诊断"/>
                <CommonItemView title="关于我们"/>
                <CommonItemView title="我要应聘"/>
                <View style={styles.style1}/>
                <CommonItemView title="精品应用"/>
                <View style={styles.style1}/>
                </ScrollView>
            </View>

        );
    }

    renderSwitch(){
        return(
            <Switch
                    value={this.state.switch}
                    onValueChange={()=>this.setState({switch:!this.state.switch})}/>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor:'#e8e8e8'
    },
    style1:{backgroundColor:'#e8e8e8',height:10},
});
